
var app = getApp();
Page({
  data: {
    img:'../../img/tupian.png',
    info:{},
    id:'',
    cate:{},
  },

  onLoad: function (options){
    this.setData({
      id:options.id
    })
    this.getinfo()
    this.getcate()
  },
  getinfo: function(){
    var that=this;
    wx.request({
      url: app.globalData.url+'api/zc/info',
      data: {
        id:that.data.id,
      },
      method: 'get',
      success:function(res){
        if(res.data.data.img){
          that.setData({
            img:app.globalData.url+res.data.data.img
          })
        }
        that.setData({
          info:res.data.data.info,
        })
      }
    })
  },
  getcate:function(){
    var that = this;
    wx.request({
      url: app.globalData.url+'api/info/showCate',
      method: 'get', 
      data:{},
      success:function(res){
        that.setData({
          cate:res.data.data,
        })
      }
    })
  },
})
